var settings = require('../settings');
var Db = require('mongodb').Db;
var Connection = require('mongodb').Connection;
var Server = require('mongodb').Server;
var mongo = new Db(settings.db, new Server(settings.host, settings.port, {auto_reconnect : true}), {w: 1});
mongo.authenticate(settings.username, settings.password, function(err, res) {
    if (err) {
		console.log("DB Error:" + err.message);
    }
    console.log("DB Connect:" + res);
});
module.exports = mongo;
